<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Value at Risk Calculation from Log-Likelihood Fit of General Pareto Distribution (GPD)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for VaR.gpd {VaR}"><tr><td>VaR.gpd {VaR}</td><td align="right">R Documentation</td></tr></table>
<h2>Value at Risk Calculation from Log-Likelihood Fit of General Pareto Distribution (GPD)</h2>


<h3>Description</h3>

<p>
Estimation of Value at Risk from log-likelihood fit of GPD.
</p>


<h3>Usage</h3>

<pre>
VaR.gpd(ydat, p = 0.01, p.tr = 0.97, drift.appx = FALSE, init = c(1, 0.3), cflevel = 0.95)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>ydat</code></td>
<td>
Numeric vector of data for which VaR is to be calculated.</td></tr>
<tr valign="top"><td><code>p</code></td>
<td>
Confidence level for VaR calculation.</td></tr>
<tr valign="top"><td><code>p.tr</code></td>
<td>
Threshold for GPD fit.</td></tr>
<tr valign="top"><td><code>drift.appx</code></td>
<td>
Logical; if <code>TRUE</code> VaR is calculated in non-zero drift approximation.</td></tr>
<tr valign="top"><td><code>init</code></td>
<td>
Initial values for log-likelihood fit of GPD.</td></tr>
<tr valign="top"><td><code>cflevel</code></td>
<td>
Confidence level for estimation of VaR and ES intervals.</td></tr>
</table>

<h3>Details</h3>

<p>
This function estimates Value at Risk and Expected Shortfall of a single risk factor with a given confidence by using a fit of Generalized
Pareto Distribution to the part of data exceeding a given threshold (Peak over Threshold (POT) Method). The input data transformed
to procentual daily return. Then, transformed data is sorted and only part exceeding a given threshold is hold. Threshold is calculated
according an expression <code>p.tr*std</code>. Log-likelihood fit is then applied to get values of VaR and ES. After that, confidence
intervals for this values are calculated (see reference for details).
</p>


<h3>Value</h3>

<p>
A list containing following components:
</p>
<table summary="R argblock">
<tr valign="top"><td><code>VaR</code></td>
<td>
Value at Risk for input data.</td></tr>
<tr valign="top"><td><code>VaR.interval</code></td>
<td>
Lower and higher bounds of VaR estimation with confidence given by parameter <code>cflevel</code>.</td></tr>
<tr valign="top"><td><code>ES</code></td>
<td>
Expected shortfall.</td></tr>
<tr valign="top"><td><code>ES.interval</code></td>
<td>
Lower and higher bounds of ES estimation with confidence given by parameter <code>cflevel</code>.</td></tr>
<tr valign="top"><td><code>data</code></td>
<td>
Same as <code>ydat</code>.</td></tr>
<tr valign="top"><td><code>cdata</code></td>
<td>
Vector of data used for GPD fit.</td></tr>
<tr valign="top"><td><code>conf.level</code></td>
<td>
Same as <code>p</code>.</td></tr>
<tr valign="top"><td><code>tr</code></td>
<td>
Same as <code>p.tr</code>.</td></tr>
<tr valign="top"><td><code>mean</code></td>
<td>
Mean value of <code>cdata</code>.</td></tr>
<tr valign="top"><td><code>std</code></td>
<td>
Standard deviation of <code>cdata</code>.</td></tr>
<tr valign="top"><td><code>gfit</code></td>
<td>
Best fit values of GPD.</td></tr>
<tr valign="top"><td><code>int.conf.level</code></td>
<td>
Same as <code>cflevel</code>.</td></tr>
</table>

<h3>Author(s)</h3>

<p>
T. Daniyarov
</p>


<h3>References</h3>

<p>
Embrechts, P., Kluepelberg, C., and Mikosch, T. (1999) Modelling
Extremal Events for Insurance and Finance. Application of Mathematics. Springer.
2nd ed. (1st ed., 1997)
</p>


<h3>See Also</h3>

<p>
<code><a href="VaR.gpd.plots.html">VaR.gpd.plots</a></code>
</p>


<h3>Examples</h3>

<pre>
data(exchange.rates)
attach(exchange.rates)
y &lt;- USDJPY[!is.na(USDJPY)]
z &lt;- VaR.gpd(y)
z$VaR
z$VaR.interval
z$ES
z$ES.interval
detach(exchange.rates)
</pre>



<hr><div align="center">[Package <em>VaR</em> version 0.2 <a href="00Index.html">Index</a>]</div>

</body></html>
